home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 June / EnigmA AMIGA RUN 19 (1997)(G.R. Edizioni)(IT)[!][issue 1997-06][EAR-CD III].iso / recent1 / ahp404.lha / AHP4 / DOpusSkripts / AHPBBS.dopus5 < prev    next >
Text File  |  1997-05-21  |  4KB  |  205 lines

  1. /* AHPBBS.dopus5 */
  2.  
  3. /*
  4.   Die angewählten Dateien werden in die ausgewählte Rubrik der AHP-BBS
  5.   eingespielt.
  6. */
  7.  
  8. options results
  9.  
  10. IF ~SHOW('Ports','rexx_AHP') THEN DO
  11.   Alertbox 'AHP4 ist nicht aktiv!'
  12.   exit 5
  13. end
  14.  
  15. IF ~SHOW('Ports','DOPUS.1') THEN DO
  16.   Alertbox 'OPUS ist nicht aktiv!'
  17.   exit 5
  18. end
  19.  
  20. address 'DOPUS.1'
  21.  
  22. lister query source
  23. if result="RESULT" then exit 0
  24. listernr = result
  25.  
  26. lister query listernr path
  27. if result="RESULT" then exit 0
  28. sourcedir = result
  29. entries = 0
  30. illegalfound = 0
  31.  
  32. mycall = "DG9BJA"        /*  <==       Muß angepaßt werden !!! */
  33.  
  34. lister query listernr numselfiles
  35. if result = 0 then exit 0
  36. max = result
  37.  
  38. result = ""
  39. lister getstring listernr '"Einspielrubrik (z.B. dl6ocl @ dk0mav)?"'
  40. if result = "" then exit 0
  41. board = upper(result)
  42.  
  43. /*
  44.     board zerlegen in zielboard und ziel
  45. */
  46.  
  47. if board = "" then exit
  48.  
  49. board = translate(board, " ", "@")
  50.  
  51. zielboard = strip(word(board, 1))
  52. ziel = strip(word(board, 2))
  53. board = zielboard
  54.  
  55. if ziel = "" then do
  56.   ziel = "AHP"
  57. end
  58.  
  59. call Init_Board(zielboard)
  60.  
  61.  
  62. if GetClip(zielboard) = "BUSY" then do
  63.   say 'Rubrik ist blockiert. :-('
  64.   exit
  65. end
  66.  
  67.  
  68. lister request listernr '"Transfer einzeln(J) oder zusammen(N)?" Ja|Nein'
  69.  
  70. einzeln = rc
  71.  
  72. if ~einzeln then do
  73.   result = ""
  74.   lister getstring listernr '"Basisbezeichnung (z.B. Test.lha.)?"'
  75.   if result = "" then do
  76.      Call SetClip(zielboard, "FREE")
  77.      exit
  78.   end
  79.   basis = result
  80.   if basis = einzeln then do
  81.      Call SetClip(zielboard, "FREE")
  82.      exit
  83.   end
  84.   lister getstring listernr '"Endung? (z.B. /04)"'
  85.   termi = result
  86.   if termi = basis then do
  87.      Call SetClip(zielboard, "FREE")
  88.      exit
  89.   end
  90. end
  91.  
  92. m = GetLastEntry(zielboard)
  93. m = m + 1
  94.  
  95. call SetClip(zielboard, "BUSY")
  96.  
  97. lister query listernr selfiles stem files
  98.  
  99. do counter = 0 to files.count-1
  100.     name = files.counter
  101.     sourcename = sourcedir||name
  102.     endung = right(name, 3)
  103.     upname = basis||right(name, 3)
  104.  
  105.     address 'rexx_AHP'
  106.     'getsystime'
  107.     zeit = AdaptTime(result)
  108.     address 'DOPUS.1'
  109.  
  110.     erfolg =0
  111.  
  112.     if ~einzeln & upper(left(endung, 1)) ~= "P" & upper(endung) ~= "7PL" then do
  113.       if illegalfound = 0 then do
  114.         alertbox "Keine 7+-Datei!!"
  115.         illegalfound = 1
  116.       end
  117.     end
  118.     else if ~einzeln then do
  119.       titel = upname||termi
  120.       erfolg = 1
  121.     end
  122.     else do
  123.       result = ""
  124.       lister getstring listernr '"Welcher Titel?"'
  125.       if result = "" then do
  126.           call SetClip(zielboard, "FREE")
  127.           exit
  128.       end
  129.       titel = result
  130.       erfolg = 1
  131.     end
  132.  
  133.     if erfolg then do
  134.       text = sourcename||" in Rubrik "||zielboard||" @ "||ziel||" aufgenommen"
  135.       say text
  136.  
  137.       if Open(entryinfo, "ahp4:BBS/"||zielboard||"/"||m||".entr", "W") then do
  138.         call writeln(entryinfo, mycall)
  139.         call writeln(entryinfo, word(zeit, 1))
  140.         call writeln(entryinfo, word(zeit, 2))
  141.         call writeln(entryinfo, ziel)
  142.         call writeln(entryinfo, titel)
  143.  
  144.         call close(entryinfo)
  145.  
  146.         address command
  147.         'copy '||sourcename||' to ahp4:BBS/'||zielboard||'/'||m
  148.         address 'DOPUS.1'
  149.       end
  150.  
  151.       m = m + 1
  152.     end
  153.     address 'DOPUS.1'
  154.     lister select listernr name
  155.  
  156. end
  157.  
  158. lister refresh listernr full
  159.  
  160. call SetClip(zielboard, "FREE")
  161.  
  162. exit 0
  163.  
  164. AdaptTime: procedure
  165. parse arg zeit
  166.  
  167. uhrzeit = word(zeit, 1)
  168. datum = word(zeit, 2)
  169.  
  170. uhrzeit = left(uhrzeit, 5)
  171. datum = left(datum, 6)||right(datum, 2)
  172.  
  173. erg = uhrzeit||" "||datum
  174. return erg
  175.  
  176. GetLastEntry: procedure
  177. parse arg board_name
  178.  
  179. count = 0
  180.  
  181. do forever
  182.   dummy = count + 1
  183.   if exists("ahp4:BBS/"||board_name||"/"||dummy) then do
  184.     count = count + 1
  185.   end
  186.   else do
  187.     leave
  188.   end
  189. end
  190.  
  191. return count
  192.  
  193. init_board: procedure
  194. parse arg board_name
  195.  
  196. if ~exists("ahp4:BBS/"||board_name) then do
  197.   address command
  198.   'makedir ahp4:BBS/'||board_name
  199.   address 'rexx_AHP'
  200.  
  201.   call setclip(board_name, "FREE")
  202. end
  203.  
  204. return
  205.